package com.cn.front.controller;

import com.cn.common.pojo.ResultModel;
import com.cn.front.feign.NewsForHomeFeign;
import com.cn.front.feign.ProjectFeign;
import com.cn.front.feign.TeamForHomeFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("home")
public class HomeController {
    @Autowired
    private TeamForHomeFeign teamForHomeFeign;
    @Autowired
    NewsForHomeFeign newsForHomeFeign;
    @Autowired
    ProjectFeign projectFeign;
    @RequestMapping("home")
    private Map home(){
        Map map = new HashMap<>();
        map.put("team",teamForHomeFeign.team());
        map.put("news",newsForHomeFeign.news());
        map.put("item",projectFeign.item());
        return map;
    }
    @RequestMapping("team")
    private ResultModel team(){
        return teamForHomeFeign.teamForTeam();
    }
}
